cmake_minimum_required(VERSION 3.24)
#project(Clion_CppTest C)       # 仅支持C, 不支持C++
#project(Clion_CppTest)         # 支持C, C++
project(Clion_CppTest C CXX)    # 支持C, C++

set(CMAKE_C_STANDARD 99)

# 点击运行时, 控制台输出乱码问题
IF (WIN32)
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fexec-charset=GBK")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fexec-charset=GBK")
ENDIF ()

add_executable(Clion_CppTest
        # 工具
        Utils/Global.c
        Utils/FileIOUtils.h
        Utils/StringFormatUtils.h
        Utils/JavaType.h
        Utils/Random.h
        Utils/KeyBoardUtils.h

        # 实体
        entity/Student.h        # 学生
        entity/Student_Pointer.h
        entity/Union_Var.h
        entity/enum_Week.h

        # 基础
#        1Basic/3.Key_words.c
#        1Basic/4.Date_types.c
#        1Basic/20.local_variate_and_global_variate.c
#        1Basic/21.function_and_static_function.c
#        1Basic/22.malloc_and_free_and_memset.c
#        1Basic/23.memset_memcpy_others.c
#        1Basic/24.struct_test.c
#        1Basic/25.union_test.c
#        1Basic/26.enum_test.c
#        1Basic/27.typedef_test.c
#        1Basic/36.pointer_function.c

        # 头文件 基础
        2BasicH/1.Custom_H.h
#        2BasicH/stdio.h.c
#        2BasicH/stdlib.h.c
#        2BasicH/string.h.c
#        2BasicH/Windows.h.c

        # 文件操作
#        3File/1.file_read_write.c
#        3File/2.file_encode_decode.c
#        3File/3.four_role_caculate_100.c
#        3File/4.fprintf_fscanf.c
#        3File/5.w_plus_open.c
#        3File/6.fread_fwrite_binary_file.c
#        3File/7.file_encode_decode2.c
#        3File/8.big_file_copy.c
#        3File/9.file_random_read_write.c
#        3File/9.5.a_plus_open.c
#        3File/10.remove_rename.c
#        3File/11.file_cache_flush.c

        # 快译通
        4Quick_Translate/quick_translate.h
#        4Quick_Translate/quick_translate.c

        # 贪吃蛇
        5Gluttonous_Snake/gluttonous_snake.h
#        5Gluttonous_Snake/gluttonous_snake.c     # 贪吃蛇

        # Visual Studio 时的文件&其它c文件
        c_file/main.c
#        c_file/1.memory_problem.c
#        c_file/9_neicunsiqu_test.c

        # C++ 文件
        CppFile/CPPTestProject.cpp
        CppFile/virtual_test.cpp

        )
